<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="./css/reg.css" rel="stylesheet" type="text/css" />
    <link href="./css/reg.css" rel="stylesheet" type="text/css" />
    <link href="./plugins/css/font-awesome.css" rel="stylesheet" type="text/css" />
    <script src="assets/js/jquery2.js"></script>
    <script src="assets/plugins/layer/layer.js"></script>
    <script>
        $(document).ready(function(){
            $("#iconAction").click(function(){
                $(".main").slideToggle(500);
                if($("#iconAction").hasClass("fa-angle-double-up")){
                    $("#iconAction").removeClass("fa-angle-double-up").addClass("fa-angle-double-down")
                }else{
                      $("#iconAction").removeClass("fa-angle-double-down").addClass("fa-angle-double-up")
                }
                })
            })
            //表单提交时的校验
          $("#formReg").submit(function(){
            $.ajax({
                url:"http://kjxycode.zisu.edu.cn/interfaceCommonForUser/insertUser",
                type:"post",
                data:{
                    token:"kjxy_Interface_2024",
                    userPhone:$("#tbPhone").val(),
                    userPwd:$("#tbPwd").val,
                    userNameword:$("#tbNickName").val(),
                    userNickname:$("#tbNickName").val()
                },
                dataType:"json",
                success:function(e){
                    //let result=$.parseJSON(e)
                    if(e.status==600){
                        layer.alert(e.msg,{
                            icon:6,
                            yes:function(index,layer){
                            layer.close(index);
                            window.location.href="login.html"
                    }
                })
              }
            }
        })
            return false;
    })
    
          //点击叉叉时图标后隐藏显示主要区域\
          $("#iconAction").click(function(){
            $(".main").slideToggle(3000);
          })
    </script>

</head>
<body>
    <div class="container">
        <div class="title">
            用户注册 
            <i class="fa fa-angle-double-up" id="iconAction"></i>
        </div>
        <div class="main">
            <form name="formReg" id="formReg">
                <div class="formItem">
                    <input type="text" placeholder="请输入账号（手机）" required pattern="^1[35789][0-9]{9}$" title="请输入正确格式的手机号" />
                    <div class="icon">
                        <i class="fa fa-user"></i>
                    </div>
                </div>
                <div class="formItem">
                    <input id="tbPwd" type="password" placeholder="请输入密码" required />
                    <div class="icon iconPWD"></div>
                </div>
                <div class="formItem">
                    <input id="tbPwdConfirm" type="password" id="pwdConfirm" placeholder="请再次输入密码" required />
                    <div class="icon iconPWD"></div>
                </div>
                <div class="formItem">
                    <input id="tbNickName" type="text" placeholder="请输入站内昵称" required />
                    <div class="icon iconUser"></div>
                </div>
                <div class="btnItem">
                    <button><i class="fa fa-user-plus"></i> 确认注册</button>
                    <a href="forgetPwd.html" class="linkReg">忘记密码？</a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>